<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>使用组件的细节点</title>
    <script src="../vue.js"></script>
</head>

<body>
    <div id="root">
<!--        ref获取的内容是<div></div>元素-->
        <div ref='hello'
             @click="handleClick"
        >
            hello world
        </div>
    </div>

    <script>
        var vm = new Vue({
            el:"#root",
            methods:{
                handleClick:function () {
                   alert(this.$refs.hello.innerHTML);
                }
            }
        })
    </script>

</body>
</html>